package cn.tedu.boot32.mapper;

import cn.tedu.boot32.entity.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @Classname: UserMapper
 * @Author: bromide
 * @CreateTime: 2022/5/12--16:42
 * @Version: V1.0
 * @Description:
 */
@Mapper
public interface UserMapper {

    @Select("select * from user where username=#{username}")
    User selectByUsername(String username);

    @Select("select * from user")
    List<User> select();

    @Insert("insert into user values(null,#{username},#{password},#{nickname})")
    void insert(User user);

    @Delete("delete from user where username=#{username}")
    void delete(String username);

    @Update("update user set username=#{username},password=#{password},nickname=#{nickname} where id=#{id}")
    void update(User user);


}
